package com.flyee.io.socket {
	
	import com.flyee.communicate.Handler;
	import com.flyee.io.socket.command.down.CommandDown;
	import com.flyee.service.pool.ObjectCollection;
	import com.flyee.utils.MyLog;
	
	public class HandlerDispatcher {
	    public static function dispatch(cmd:CommandDown):void
	    {
	        MyLog.debug("dispatch :"+cmd);
	    	var o:Object = ObjectCollection.beansContext.getObject(cmd.handler);
	        if(o==null)
	        {
	            MyLog.error("No registed handler:"+cmd.handler);
	            return;
	        }
	        var handler:Handler = o as Handler;
	        handler.process(cmd);
	    }
	}
}